from typing import Optional, List, Union, Annotated
from pydantic import BaseModel, Field

class Address(BaseModel):
    city: str
    street: str
    zip_code: str = Field(pattern=r"^\d{5,6}$")

class UserProfile(BaseModel):
    id: int
    name: str
    email: str
    address: Optional[Address] = None
    tags: List[str] = []

class UploadInitRequest(BaseModel):
    filename: str
    size: int
    part_size: int = 5 * 1024 * 1024

class UploadInitResponse(BaseModel):
    upload_id: str
    part_size: int

# 响应包裹模型示例
class ApiResponse(BaseModel):
    message: str = "OK"
    data: Optional[dict] = None
